$(document).ready(function(){
	 
	tinymce.init({selector:'textarea', language:'pt_BR'});

	oTable = $('#tcontrato').dataTable({
		"order": [[ 0, "desc" ]],
		"bJQueryUI": true, 
		"oLanguage": { 
			"sProcessing": "Processando...", 
			"sLengthMenu": "Mostrar _MENU_ registros", 
			"sZeroRecords": "Não foram encontrados resultados", 
			"sInfo": "Mostrando de _START_ até _END_ de _TOTAL_ registros", 
			"sInfoEmpty": "Mostrando de 0 até 0 de 0 registros", 
			"sInfoFiltered": "", 
			"sInfoPostFix": "", 
			"sSearch": "Buscar:", 
			"sUrl": "", 
			"oPaginate": { 
				"sFirst": "Primeiro", 
				"sPrevious": "Anterior", 
				"sNext": "Seguinte", 
				"sLast": "Último" 
			}
		},
		"bAutoWidth": false,
		"bDestroy": true,
		"bPaginate": true,
		"bJQueryUI": true,
		"sPaginationType": "full_numbers"
	});
	$("#ver").click(function(e){
		var id= $("#ver").attr('value');
		var link = $('#base_url').val() + "contrato/visualizaContrato/"+id;
		$.fancybox({
			'maxWidth'	: 600,
			'maxHeight'	: 900,
			'openEffect': 'elastic',
			'closeEffect': 'elastic',
			'type': 'iframe',
			'href': link,
			afterClose: function () {
                parent.location.reload(true);
            }
		});
		return false;
	});	
});